<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %> 
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>还款申请记录</title>
<jsp:include page="../../import.jsp" flush="true" />
<%--<jsp:include page="assParkCommon.jsp" flush="true" /><!-- 时间格式转换 -->--%>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div>
        <form id="repay_form">
            <div class="sqPanel">
                <div class="sqPanel_head inL">
                    <span>还 款 申 请 记 录</span>
                </div>
            </div>
            <div class="sqPanel">
                <!-- 列表显示块 -->
                <div id="ligergrid_his" class="sq-grid"></div>
            </div>
            <%--还款（付款）ids--%>
            <input name="paydtlRIds" id="paydtlRIds" type="hidden" value="${paydtlRIds}">
        </form>
    </div>
</div>

<script type="text/javascript">
    var paySchDtlId = '${paySchDtlId}';
    var repayDtlId = '${repayDtlId}';//用于剔除当前申请当作历史记录

	$(function () {
        initGrid_his();//初始还款历史列表

	});

    //初始化列表 历史还款
    function initGrid_his(){
        $("#ligergrid_his").ligerGrid({
            // data: data,
            method:'get',
            url:'<%=path%>/finance/finRepayApplyInfo/selectRepayHis.do?paySchDtlId='+paySchDtlId+'&&repayDtlId='+repayDtlId,
            columns:[
                { display: '实际还款金额(元)', name: 'accRepayAmt', width: 150, enabledSort:true,
                    render:function (rowdata, rowindex, value, column){
                        if (value == 0) {
                            return "0";
                        }
                        return value/100;
                    }
                },
                { display: '还款流程编号', name: 'repayAccNo', width: 200, enabledSort:true,
                    render: function (rowdata, index, value) {
                        var h ="";
                        if( rowdata.pNo != null){
                            h+='<a class="sq-button-hasicon" href="javascript:commShowFlow(';
                            h+="'"+rowdata.pInstId+"'";
                            h+=",'"+rowdata.audStsCd+"'";
                            h+=",'"+rowdata.dataId+"'";
                            h+=",'"+rowdata.formUrl+"'";
                            h+=")\"><i class='sqBtnIco_32'></i>"+rowdata.pNo+"</a>";
                        }
                        return h;
                    },
                },

            ],
            usePager: false,//是否有分页便签
            root:'rows',
            record:'total',
            hideLoadButton:false,
            width:'100%',
            height:'100%',
            heightDiff:-2,
            isScroll: false,//是否有滚动条
            checkbox:false,//列表是否有选择框
            // enabledEdit: true,//是否能编辑
            rownumbers:true//列表是否有行号
        });
        grid = liger.get("ligergrid1");
        //grid.setHeight(100);
        // grid.options.isSingleCheck = true;//列表是否为单选
    }

    //显示流程：流程实例ID,状态,业务主键(还款)
    function commShowFlow(_pInstId, _audStsCd, _businessKey,_formUrl){
        if(StringUtils.isEmpty(_pInstId)){
            UIUtils.alertWarning(CommonConstant.C_P_INSTANCEID_NOT_HERE);
            return;
        }
        var params = "?pInsId="+_pInstId+"&status="+_audStsCd+"&businessKey="+_businessKey+"&formUrl="+_formUrl;
        Add_navTab('tab_ass_trail_flow_'+_businessKey,'查看流程',"<%=path%>/flow/flow/toFlowShowPageFowBus.do"+params);
    }

</script>
</body>
</html>